/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

/**
 *
 * @author hicham
 */
public class WeightedObject implements Comparable {
    private Comparable weight;
    private Object object;

    public WeightedObject(Comparable weight, Object object) {
        this.weight = weight;
        this.object = object;
    }

    public Object getObject() {
        return object;
    }

    public void setObject(Object object) {
        this.object = object;
    }

    public Comparable getWeight() {
        return weight;
    }

    public void setWeight(Comparable weight) {
        this.weight = weight;
    }

    @Override
    public int compareTo(Object o) {
        WeightedObject wo = (WeightedObject)o;
        return this.weight.compareTo(wo.weight);
    }

 }
